﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.MiniQuest {
    import flash.events.*;
    import Engine.Helpers.*;
    import Classes.util.*;
    import Display.hud.components.*;
    import Engine.*;
    import Display.hud.*;

    public class GiftMQ extends MiniQuest {

        public static const QUEST_NAME:String = "giftMQ";

        public function GiftMQ(){
            m_recurrenceTime = Global.gameSettings.inGameDaySeconds;
            super(QUEST_NAME);
        }
        override protected function onIconClicked(_arg1:MouseEvent):void{
            super.onIconClicked(_arg1);
            if (Utilities.isFullScreen()){
                Utilities.setFullScreen(false);
            };
            Global.player.setLastActivationTime(m_questName, int((GlobalEngine.getTimer() / 1000)));
            FrameManager.navigateTo("gifts.php?ref=free_gift_icon");
        }
        override protected function initQuest():void{
            var _local1:String;
            var _local2:int;
            if (((m_assetsLoaded) && (!(m_questActive)))){
                _local1 = ZLoc.t("Dialogs", ("Mini_" + m_questName));
                _local2 = 0;
                if (((Global.hud.getComponent(HUD.COMP_QUESTS)) && ((Global.hud.getComponent(HUD.COMP_QUESTS) as HUDQuestBarComponent).container))){
                    _local2 = (Global.hud.getComponent(HUD.COMP_QUESTS) as HUDQuestBarComponent).container.getNextAvailableSlot();
                };
                Global.hud.showMiniQuestSprite(m_questName, _local1, m_questHudIcon, this.onIconClicked, _local2);
                Global.hud.showGoalsProgressOverlayOnQuestIcon(m_questName, "send");
                m_questActive = true;
            };
        }
        override protected function get miniQuestLabel():String{
            return (ZLoc.t("Main", "FreeGifts"));
        }
        override protected function get miniQuestLabelOffset():Vector2{
            return (new Vector2(-2, 25));
        }

    }
}//package Classes.MiniQuest 
